﻿@using cloudscribe.Core.Models
@using cloudscribe.Core.Identity
@using cloudscribe.Web.Navigation
@using cloudscribe.Web.Pagination
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper "*, cloudscribe.Web.Common"
@addTagHelper "*, cloudscribe.Web.Navigation"
@addTagHelper "*, cloudscribe.Web.Pagination"
@addTagHelper "*, cloudscribe.Core.Web"
@inject SiteContext Tenant
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewData["Title"] - @(Tenant?.SiteName ?? "Sample")</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    @RenderSection("Meta", required: false)
    <environment names="Development">
        <link rel="stylesheet" href="~/css/bootstrap.css" cs-resolve-theme-resource="true" cs-tenant="@Tenant" />
        <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
    </environment>
    <environment names="Staging,Production">
        <link rel="stylesheet" href="~/css/bootstrap.min.css" cs-resolve-theme-resource="true" cs-tenant="@Tenant" />
        <link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
    </environment>
    @RenderSection("Styles", required: false)
    <google-analytics profile-id="@Tenant.GoogleAnalyticsProfileId" user-id="@User.GetUserId()"></google-analytics>
</head>
<body class="@ViewData["BodyClass"]">
    <header class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="~/@(Tenant?.SiteFolderName ?? "")" class="navbar-brand">@(Tenant?.SiteName ?? "Sample")</a>
            </div>
            <nav class="navbar-collapse collapse">
                @await Component.InvokeAsync("Navigation", new { viewName = "BootstrapTopNavWithDropdowns", filterName = NamedNavigationFilters.TopNav, startingNodeKey = "" })
                @await Html.PartialAsync("_LoginPartial")
            </nav>
        </div>
    </header>
    @RenderSection("Toolbar", required: false)
    <div class="container body-content">
        @await Component.InvokeAsync("Navigation", new { viewName = "BootstrapBreadcrumbs", filterName = NamedNavigationFilters.Breadcrumbs, startingNodeKey = "" })
        @await Html.PartialAsync("AlertsPartial")
        @RenderBody()
        @RenderSection("SideNav", required: false)
    </div>
    <footer class="container text-center">
        <small>Copyright &copy; @DateTime.Now.Year - @(Tenant?.SiteName ?? "Sample")</small><br />
        <small>
            <a href="/sitemap">Site Map</a> |
            @* you are free to remove the powered by cloudscribe link but we appreciate it if you choose to keep it! *@
            <a target="_blank" href="https://www.cloudscribe.com/?utm_source=@Context.Request.Host.Value&amp;utm_medium=referral&amp;utm_campaign=poweredbycloudscribe">Powered by cloudscribe</a>
        </small>
        <div class="addthis_inline_follow_toolbox"></div>
    </footer>
    <environment names="Development">
        <script src="~/js/jquery.js" cs-resolve-theme-resource="true" cs-tenant="@Tenant"></script>
        <script src="~/js/bootstrap.js" cs-resolve-theme-resource="true" cs-tenant="@Tenant"></script>
    </environment>
    <environment names="Staging,Production">
        <script src="~/js/jquery.min.js" cs-resolve-theme-resource="true" cs-tenant="@Tenant"></script>
        <script src="~/js/bootstrap.min.js" cs-resolve-theme-resource="true" cs-tenant="@Tenant"></script>
    </environment>
    @RenderSection("Bottom", required: false)
    @RenderSection("scripts", required: false)
    <add-this profile-id="@Tenant.AddThisDotComUsername" async></add-this>

</body>
</html>
